package com.sgb.kjwl.di.device;

import com.sgb.kjwl.repository.DeviceRepertory;
import com.sgb.kjwl.repository.impl.DeviceRepertoryImpl;
import com.sgb.kjwl.view.ui.activity.device.DeviceDetailActivity;
import com.sgb.kjwl.view.ui.activity.device.DeviceListActivity3;
import com.sgb.kjwl.view.ui.activity.self.publish.DevicePublishDetailActivity;
import com.sgb.kjwl.viewmodel.device.DeviceDetailModel;
import com.sgb.kjwl.viewmodel.device.DeviceListModel3;
import com.sgb.kjwl.viewmodel.self.publish.DevicePublishDetailModel;
import com.swgk.core.base.di.Activity;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import dagger.Module;
import dagger.Provides;

@Module
public class DeviceModule {

    private DeviceDetailActivity detailActivity;
    private DevicePublishDetailActivity devicePublishDetailActivity;
    private DeviceListActivity3 deviceListActivity3;

    public DeviceModule(DeviceDetailActivity detailActivity) {
        this.detailActivity = detailActivity;
    }

    public DeviceModule(DevicePublishDetailActivity devicePublishDetailActivity) {
        this.devicePublishDetailActivity = devicePublishDetailActivity;
    }

    public DeviceModule(DeviceListActivity3 deviceListActivity3) {
        this.deviceListActivity3 = deviceListActivity3;
    }

    @Provides
    @Activity
    DeviceRepertory provideDeviceRepertory(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        return new DeviceRepertoryImpl(apiSource, preferenceSource) {
        };
    }

    @Provides
    @Activity
    DeviceDetailModel provideDeviceDetailModel(DeviceRepertory repertory) {
        return new DeviceDetailModel(detailActivity, repertory);
    }

    @Provides
    @Activity
    DevicePublishDetailModel devicePublishDetailModel(DeviceRepertory repertory) {
        return new DevicePublishDetailModel(devicePublishDetailActivity, repertory);
    }

    @Provides
    @Activity
    DeviceListModel3 provideDeviceListModel3(DeviceRepertory repertory) {
        return new DeviceListModel3(deviceListActivity3, repertory);
    }

}
